package com.syf.kit.soa.core;

import lombok.Data;

@Data
public class SyfRpcMsg {
    /**
     * 魔数
     */
    private String magicNum;

    /**
     * 版本号
     */
    private String version;

    /**
     * 请求类型，0-心跳；1-request/response;2-trigger触发;
     */
    private byte reqType;

    /**
     * 业务报文类型： 1-json
     */
    private byte bizDataType;

    /**
     * 调用计数，用于分布式日志的排序
     */
    private Integer callCount;

    /**
     * 请求号
     * */
    private Long reqUUID;

    /**
     * 交易码，10byte
     */
    private String serviceCode;

    /**
     * 保留域
     */
    private byte[] reserved;

    /**
     * 业务报文的byte长度
     */
    private Integer bizDataLen;

    /**
     * 业务报文
     */
    private String bizData;


    public SyfRpcMsg() {
    }

    public SyfRpcMsg(String magicNum, String version, byte reqType, byte bizDataType, Integer callCount, Long reqUUID, String serviceCode, byte[] reserved, String bizData) {
        this.magicNum = magicNum;
        this.version = version;
        this.reqType = reqType;
        this.bizDataType = bizDataType;
        this.callCount = callCount;
        this.reqUUID = reqUUID;
        this.serviceCode = serviceCode;
        this.reserved = reserved;
        this.bizData = bizData;
    }
}
